﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using MvcCoffeeShop.DataTransferObjects;
using MvcCoffeeShop.BusinessLogic;

namespace MvcCoffeeShop.Models
{
    public class ProductModels : ModelBase 
    {

        MvcCoffeeShopBL oBusinessLogic;
        
        public ProductDTO GetProduct(int ProductID)
        {
            //Iortiz - In this method we're goign to use the classic N-Tier ADO.Net approach
            var oProduct = new ProductDTO();
          
            oBusinessLogic = new MvcCoffeeShopBL();
            oProduct = oBusinessLogic.GetProduct(ProductID);
            return oProduct;
        }

        public List<ProductDTO> GetProducts()
        {
            //IOrtiz - In this method we're going to use the more modern Entity Framework
            //to query the database
            var oProducts = new List<ProductDTO>();

            oBusinessLogic = new MvcCoffeeShopBL();
            oProducts = oBusinessLogic.GetProducts();
            
            return oProducts;
        }



    }
}